# CMake 最低版本号要求
cmake_minimum_required (VERSION 2.8)

project(PolarisAudio)

set(CMAKE_CXX_STANDARD 11)


include_directories(AudioHelper/Audio)
include_directories(AudioHelper/Opus)
# include_directories(AudioHelper/VLC)

# 执行Shell命令，结果存于 GIT_VERSION_OUTPUT 变量中
execute_process(COMMAND git rev-parse HEAD OUTPUT_VARIABLE GIT_VERSION_OUTPUT)


aux_source_directory(. SRC_LIST)
aux_source_directory(AudioHelper/Audio SRC_LIST)
aux_source_directory(AudioHelper/Opus SRC_LIST)
# aux_source_directory(AudioHelper/VLC SRC_LIST)


add_executable(PolarisAudio ${SRC_LIST})

# 查找ALSA库
find_package(ALSA REQUIRED)
include_directories(${ALSA_INCLUDE_DIRS})

# 链接 Opus, Ogg 和 ALSA 库
if(ALSA_FOUND)
    target_link_libraries(PolarisAudio PRIVATE opus ogg ${ALSA_LIBRARIES})
else()
    message(FATAL_ERROR "ALSA库未找到，请先安装libasound2-dev")
endif()